package com.jsong.linuo.string;

/**
 * @Author: 黎诺
 * @CreateTime: 2025-05-01
 * @Description: StringBuilder常用方法
 */

public class StringBuilder01 {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder("abc");

        //字符串拼接,返回的是StringBuilder自己
        sb.append("def").append("ghi");
        System.out.println(sb);
        //字符串翻转,返回的是StringBuilder自己
        System.out.println(sb.reverse());
        //将StringBuilder转化成String,便于后续操作
        String s = sb.toString();
        System.out.println(s);
    }
}
